<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/common/head.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="renderer" contecnt="webkit">
		<title>自动化办公系统</title>
		<link href="${resource }/css/bootstrap.css?v=3.4.0" rel="stylesheet">
<!--		<link href="font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet">-->
		<link href="${resource }/css/style.css?v=2.2.0" rel="stylesheet">
		<link rel="stylesheet" href="${resource }/css/iconfont.css" />
		<!-- Mainly scripts -->
		<script src="${resource }/js/jquery-2.1.1.min.js"></script>
		<script src="${resource }/js/bootstrap.min.js?v=3.4.0"></script>
		<script src="${resource }/js/plugins/metisMenu/jquery.metisMenu.js"></script>
		<script src="${resource }/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<!-- Custom and plugin javascript -->
		<script src="${resource }/js/hplus.js?v=2.2.0"></script>
		<script src="${resource }/js/plugins/pace/pace.min.js"></script>
		<%
		  session.setAttribute("useraccount", "user0") ;
		%>
	</head>

	<body >
		<div id="wrapper" class="wrapper" style="padding: 0  height='100%' ">
			<nav class="navbar-default navbar-static-side" role="navigation">
				<div class="sidebar-collapse">
					<ul class="nav" id="main-menu">
						<li class="nav-header">
							<div class="dropdown profile-element"> <span>
                            <img alt="image" class="img-circle" src="${resource }/img/profile_small.jpg" />
                             </span>
								<a data-toggle="dropdown" class="dropdown-toggle" href="index.html#">
									<span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">${user.getUserName() }</strong>
                             </span> <span class="text-muted text-xs block">${user.getRole() }<b class="caret"></b></span> </span>
								</a>
								<ul class="dropdown-menu animated fadeInRight m-t-xs">
									<li>
										<a href="#">修改头像</a>
									</li>
									<li>

										<a href="person/show.do?sign=0">个人资料</a>

									</li>
									<li>
										<a href="#">信箱</a>
									</li>
									<li class="divider"></li>
									<li>
										<a href="index.do?flag=out">安全退出</a>
									</li>
								</ul>
							</div>
							<div class="logo-element">
								OA
							</div>
						</li>
						<li >

							<a href="home/show.do" target="main"><i class="iconfont icon-zhuye"></i> <span class="nav-label">主页</span></a>
						</li>
						<li>
							<a href="#" class="dropdown-toggle  mydropdown" data-toggle="dropdown" ><i class="iconfont icon-informatiom"></i>内部邮件<b class="caret"></b></a>
							<ul class="dropdown-menu mymenu" style="background-color: #2F4050; color: white;">
								<li>
									<a href="mail/writeMail.do" target="main"> <span class="nav-label">写信 </span></a>
								</li>
								<li>
									<a href="mail/drafts.do" target="main"> <span class="nav-label">草稿箱 </span></a>
								</li>
								<li>
									<a href="mail/sendMail.do" target="main"><span class="nav-label">已发送 </span></a>
								</li>
								<li>
									<a href="mail/inbox.do" target="main"><span class="nav-label">收件箱 </span></a>
								</li>
								<li>
									<a href="mail/trash.do" target="main"><span class="nav-label">回收站 </span></a>
								</li>
							</ul>
						</li>
						<c:if test="${details.get(5).isPermission==1 }">
							<li>
								<a href="user/show.do" target="main"><i class="iconfont icon-yonghuguanli"></i> <span class="nav-label">用户管理</span></a>
							</li>
						</c:if>
						<c:if test="${details.get(0).isPermission==1 }">
							<li>
								<a href="notice/showAllNotice.do" target="main"><i class="iconfont icon-navicon-gggl"></i> <span class="nav-label">公告管理</span></a>
							</li>
						</c:if>
						<c:if test="${details.get(3).isPermission==1 }">
							<li>
								<a href="log/show.do" target="main"><i class="iconfont icon-rizhiguanli"></i> <span class="nav-label">日志管理</span></a>
							</li>
						</c:if>
						<c:if test="${details.get(4).isPermission==1 }">
							<li>
								<a href="workFlow/show.do" target="main"><i class="iconfont icon-liuchengguanli-"></i> <span class="nav-label">流程管理</span></a>
							</li>
						</c:if>
						<c:if test="${details.get(6).isPermission==1 }">
							<li>
								<a href="depart/show.do" target="main"><i class="iconfont icon-bumenguanli"></i> <span class="nav-label">部门管理 </span></a>
							</li>
						</c:if>
						<c:if test="${details.get(7).isPermission==1 }">
							<li>
								<a href="#" class="dropdown-toggle mydropdown" data-toggle="dropdown" ><i class="iconfont icon-zhiweishenfen"></i>角色管理<b class="caret"></b></a>
								<ul class="dropdown-menu mymenu" style="background-color: #2F4050; color: white;">
									<li>
										<a href="role/show.do" target="main"> <span class="nav-label">职位管理 </span></a>
									</li>
									<li>
										<a href="rolepermiss/show.do" target="main"><span class="nav-label">职位权限管理 </span></a>
									</li>
								</ul>
							</li>
						</c:if>
						<c:if test="${details.get(8).isPermission==1 }">
							<li>
								<a href="permission/showPermission.do" target="main"><i class="iconfont icon-quanxianguanli"></i> <span class="nav-label">权限管理 </span></a>
							</li>
						</c:if>
						<li class="dropup">
							<a href="#" class="dropdown-toggle mydropdown" data-toggle="dropdown" ><i class="iconfont icon-liucheng"></i>我的流程 <b class="caret"></b></a>
							<ul class="dropdown-menu mymenu" style="background-color: #2F4050; color: white;">
								<li>
									<a href="myflow/show.do" target="main">起草申请</a>
								</li>
								<li>
									<a href="myflow/myapply.do?id=${user.id}" target="main">我的申请</a>
								</li>
								<li>
									<a href="myflow/myapproval.do?id=${user.id}" target="main">待我审批</a>
								</li>
							</ul>
						</li>
						<li class="dropup">
							
							<a href="#" class="dropdown-toggle mydropdown" data-toggle="dropdown" ><i class="iconfont icon-chuqin"></i>出勤管理 <b class="caret"></b></a>
							<ul class="dropdown-menu mymenu" style="background-color: #2F4050; color: white;">
								<li>
									<a href="signin/showMe.do" target="main">签到</a>
								</li>
								<li>
									<a href="signin/showAll.do" target="main">部门出勤</a>
								</li>
							</ul>
						</li>
					</ul>

				</div>
			</nav>
			
			<div id="page-wrapper" class="gray-bg dashbard-1" style="background: #f3f3f4;">

				<div class="row border-bottom">
					<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
						<div class="navbar-header">
							<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="iconfont icon-liebiao"></i> </a>
						</div>
						<ul class="nav navbar-top-links navbar-right">
							
							<li class="dropdown">
								<a class="dropdown-toggle count-info" data-toggle="dropdown" href="index.html#">
									<i class="iconfont icon-chuqin"></i><span class="label label-primary" id="msg"></span>
								</a>
								<ul class="dropdown-menu dropdown-alerts">
									<li>
										<a href="#" onclick="signin()">
											<div>
												<i class="iconfont icon-chuqin"></i> 上班签到
												<span class="pull-right text-muted small"></span>
											</div>
										</a>
									</li>
									<li class="divider"></li>
									<li>
										<a href="#" onclick="signout()">
											<div>
												<i class="iconfont icon-chuqin"></i> 下班签到
												<span class="pull-right text-muted small"></span>
											</div>
										</a>
									</li>
								</ul>
							</li>
							
							<li class="dropdown">
								<a class="dropdown-toggle count-info" data-toggle="dropdown" href="index.html#">
									<i class="iconfont icon-xiaoxi"></i><span class="label label-primary" id="msg">8</span>
								</a>
								<ul class="dropdown-menu dropdown-alerts">
									<li>
										<a href="#">
											<div>
												<i class="iconfont icon-informatiom"></i> 您有16条未读消息
												<span class="pull-right text-muted small">4分钟前</span>
											</div>
										</a>
									</li>
									<li class="divider"></li>
									<li>
										<a href="#">
											<div>
												<i class="iconfont icon-xiaoxi"></i> 3条新回复
												<span class="pull-right text-muted small">12分钟前</span>
											</div>
										</a>
									</li>
								</ul>
							</li>
							<li>
								<a href="index.do?flag=out">
									<i class="iconfont icon-icon4"></i> 退出
								</a>
							</li>
						</ul>

					</nav>
				</div>
				<div id="page-inner" class=" white-bg ">
					<iframe id="external-frame" scrolling="yes" onload="setIframeHeight(this) iFrameHeight" name="main" width="100%" height="auto"  src="home/show.do" frameborder="0"></iframe>
				</div>
				<div class="row">
					<div class="footer">	
						<div>
							<strong>Copyright</strong> 猿族崛起 &copy; 2018
						</div>
					</div>
				</div>

			</div>
		</div>
		<script type="text/javascript">
			function setIframeHeight(iframe) {
				if(iframe) {
					var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
					if(iframeWin.document.body) {
						iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
					}
				}
			};

			window.onload = function() {
				setIframeHeight(document.getElementById('external-frame'));
			};

		</script>
		<script type="text/javascript">
		function signin() {
			$.ajax({

				type: 'post',
				url: 'signin/signin.do',
				success: function (data) {
					if(data=="success"){
						alert("上班签到成功");
					}else if (data=="defeat") {
						alert("上班签到失败");
					}else if (data=="exist") {
						alert("您已签到，请勿重复签到");
					}
					
				}
			});
		}
			function signout() {
				$.ajax({
					type: 'post',
					url: 'signin/signout.do',
					success: function (data) {
						if(data=="success"){
							alert("下班签到成功");
						}else if (data=="defeat") {
							alert("下班签到失败");
						}else if (data=="exist") {
							alert("您已签到，请勿重复签到");
						}else if (data=="none") {
							alert("您还没有进行上班签到");
						}
						
					}
				});
			
		}
		</script>
	</body>

</html>